package com.sskj.b70.p.activity;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.b70.m.bean.CustomListBean;
import com.sskj.b70.m.bean.HaiPageBean;
import com.sskj.b70.m.bean.HttpData;
import com.sskj.b70.m.http.JsonConverter;
import com.sskj.b70.p.base.BasePresenter;
import com.sskj.b70.v.activity.CustomActivity;

import java.util.List;

import io.reactivex.Flowable;

public class CustomPresenter extends BasePresenter<CustomActivity> {
    public Flowable<List<CustomListBean>> loadData(int page) {
        return httpService.myClient(page)
                .converter(new JsonConverter<HttpData<HaiPageBean<CustomListBean>>>() {
                })
                .adapt(new FlowableBody<>())
                .map(haiPageBeanHttpData -> haiPageBeanHttpData.getData().getRes());

    }
}
